<template>
	<view id="index">
		<u-grid :col="2">
				<u-grid-item v-for="(item, index) in list" :key="index" @click="navigatePage(item.path)">
					<u-icon :size="46" :name="item.name" custom-prefix="custom-icon"></u-icon>
					<view class="grid-text">{{item.text}}</view>
				</u-grid-item>
		</u-grid>
		
		<u-toast ref="uToast" />
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				list: [
					{path: "/blog/index/index", name: "boke", text: "博客"},
					{path: "/novel/index/index", name: "xiaoshuo", text: "小说"},
					{path: "/cook/index/index", name: "caipu", text: "菜谱"},
					
					{path: "", name: "qita", text: "敬请期待..."},
				]
			};
		},
		methods: {
			navigatePage(path) {
				if(!path){
					this.$refs.uToast.show({
						title: '暂未开发',
					})
					return;
				}
				uni.navigateTo({
					url: path
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	#index{
		image{
			width: 80rpx;
			height: 80rpx;
		}
	}
	.grid-text {
			font-size: 28rpx;
			margin-top: 4rpx;
			color: $u-type-info;
		}
</style>
